import { actions, S } from "../store"
import { useSelect } from '../redux'
const Minus = () => {

    const name = useSelect((state: S) => state.name)
    const age = useSelect((state: S) => state.age)
    const minus = () => actions.minus(1)
    const minusAsync = () =>actions.minusAsync(100)

    return <div>
        <h1>Minus</h1>
        <p>name: {name}</p>
        <p>
            <span>age: </span>
            <span>{age}</span>
            <button onClick={minus} >-</button>
            <button onClick={minusAsync} >异步减</button>
        </p>
    </div>
}

export default Minus